package com.leet.meituan;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class XuanTiao {
    private static Set<Integer> set;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = Integer.parseInt(scanner.nextLine());
        set = new HashSet<>();
        for(int i = 0; i < n; i++){
            int size = set.size();
            String[] line = scanner.nextLine().split(" ");
            for(int j = 0;j < n;j++){
                set.add(Integer.parseInt(line[j]));
                if(set.size() > size){
                    System.out.print(line[j]+" ");
                    break;
                }
            }
        }
    }
}
//5
//1 5 3 4 2
//2 3 5 4 1
//5 4 1 2 3
//1 2 5 4 3
//1 4 5 2 3


